<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="jquery.3.4.1.js"></script>
    <style>
        .mask{
            position: absolute;
            background-color:rgba(0,0,0,0.5) ;
            width: 100%;
            height: 100%;
            top: 0;
            left: 0;
        }
        .t{
            position: absolute;
            background-color: white;
            width: 400px;
            height: 300px;
            top: 50%;
            left: 50%;
            margin-left: -200px;
            margin-top: -150px;
        }
    </style>
</head>
<body>
<h1>python全栈23期皇家赌场黄了</h1>
<div class="mask">
    <div class="t"></div>
</div>
</body>
<script>
    // $('input').keyup(
    //     function (e) {
    //         if(e.keyCode===27){
    //             $(this).css('display','none')
    //         }
    //     }
    // )
    $(window).keyup(function (e) {
        // console.log(arguments) //帮助你查看想不起来的函数参数都有哪些
        if(e.keyCode===27){
            $('.mask').css('display','none')
        }
    })

</script>
</html>